<template>
  <div class="bottom-charts">
    <div class="bc-chart-item">
      <div id="bottom">
      </div>
      </div>
  </div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'BottomCharts',
  components: {
  },
  data () {
    return {
    }
  },
  mounted () {
    this.getBottomChart()
  },
  methods: {

    getBottomChart () {
      const chartDom = document.getElementById('bottom')
      const myChart = echarts.init(chartDom)
      const option = {
        color: ['#80FFA5', '#00DDFF', '#37A2FF', '#FF0087', '#FFBF00'],
        title: {
          text: '分行各科目报销统计',
          textStyle: {
            color: '#fff'
          }
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: '#6a7985'
            }
          }
        },
        legend: {
          // data: ['Line 1', 'Line 2', 'Line 3', 'Line 4', 'Line 5'],
          textStyle: {
            color: '#fff'
          }
        },
        toolbox: {
          feature: {
            saveAsImage: {}
          }
        },
        grid: {
          left: '2%',
          right: '4%',
          bottom: '2%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line',
            smooth: true
          },
          {
            data: [120, 132, 101, 134, 90, 230, 210],
            type: 'line',
            smooth: true
          },
          {
            data: [120, 282, 111, 234, 220, 340, 310],
            type: 'line',
            smooth: true
          },
          {
            data: [320, 132, 201, 334, 190, 130, 220],
            type: 'line',
            smooth: true
          },
          {
            data: [150, 232, 201, 154, 190, 330, 410],
            type: 'line',
            smooth: true
          },
          {
            data: [220, 302, 181, 234, 210, 290, 150],
            type: 'line',
            smooth: true
          },
          {
            data: [600, 502, 451, 354, 440, 530, 560],
            type: 'line',
            smooth: true
          }
        ]
      }

      option && myChart.setOption(option)
    }

  }
}
</script>

<style lang="less">
#bottom{
  width: 100%;
  height: 100%;
}
.bottom-charts {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;

  .bc-chart-item {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
  }

}
</style>
